﻿using System.Web;
using Microsoft.Practices.Unity;
using BF.Infrastructure;
using BF.UnityFactory;
using BF.IDAL.BaseSystem;
using BF.SQLServerDAL.BaseSystem;
using BF.IBLL.BaseSystem;
using BF.BLL.BaseSystem;
using BF.IBLL.Dictionary;
using BF.BLL.Dictionary;
using BF.IDAL.Dictionary;
using BF.SQLServerDAL.Dictionary;
using BF.IBLL.BaseSystem.AreaManagement;
using BF.BLL.BaseSystem.AreaManagement;
using BF.Model;
using BF.IDAL.IXZCF_WS_AJSLJLDALLibrary;
using BF.SQLServerDAL.XZCF_WS_AJSLJLDALLibrary;
using BF.IBLL.IXZCF_WS_AJSLJLBLLLibrary;
using BF.BLL.XZCF_WS_AJSLJLBLLLibrary;
using BF.IDAL.IXZCF_WS_LABGDALLibrary;
using BF.SQLServerDAL.XZCF_WS_LABGDALLibrary;
using BF.IBLL.IXZCF_WS_LABGBLLLibrary;
using BF.BLL.XZCF_WS_LABGBLLLibrary;
using BF.IDAL.IXZCF_WS_AJYSSDALLibrary;
using BF.SQLServerDAL.XZCF_WS_AJYSSDALLibrary;
using BF.IBLL.IXZCF_WS_AJYSSBLLLibrary;
using BF.BLL.XZCF_WS_AJYSSBLLLibrary;
using BF.IDAL.IXZCF_WS_XWBLDALLibrary;
using BF.SQLServerDAL.XZCF_WS_XWBLDALLibrary;
using BF.IBLL.IXZCF_WS_XWBLBLLLibrary;
using BF.BLL.XZCF_WS_XWBLBLLLibrary;
using BF.IDAL.IXZCF_WS_ZJBCJDSDALLibrary;
using BF.SQLServerDAL.XZCF_WS_ZJBCJDSDALLibrary;
using BF.IBLL.IXZCF_WS_ZJBCJDSBLLLibrary;
using BF.BLL.XZCF_WS_ZJBCJDSBLLLibrary;
using BF.IDAL.IXZCF_WS_ZJBCCLJDSDALLibrary;
using BF.SQLServerDAL.XZCF_WS_ZJBCCLJDSDALLibrary;
using BF.IBLL.IXZCF_WS_ZJBCCLJDSBLLLibrary;
using BF.BLL.XZCF_WS_ZJBCCLJDSBLLLibrary;
using BF.IDAL.IXZCF_WS_AJDCZJBGDALLibrary;
using BF.SQLServerDAL.XZCF_WS_AJDCZJBGDALLibrary;
using BF.IBLL.IXZCF_WS_AJDCZJBGBLLLibrary;
using BF.BLL.XZCF_WS_AJDCZJBGBLLLibrary;



namespace BF.Web.App_Code
{
    public class UnityRegister
    {
        public static void Register(HttpApplicationState Application)
        {
            IUnityContainer unityContainer = new UnityContainer();

            #region WSJD_BaseFrameworkEntities 卫生监督数据库
            unityContainer.RegisterType<IUnitOfWork<WSJD_BaseFrameworkEntities>, UnitOfWork<WSJD_BaseFrameworkEntities>>(new HttpContextLifetimeManager<IUnitOfWork<WSJD_BaseFrameworkEntities>>());
            unityContainer.RegisterType<IDatabaseFactory<WSJD_BaseFrameworkEntities>, DatabaseFactory<WSJD_BaseFrameworkEntities>>(new HttpContextLifetimeManager<IDatabaseFactory<WSJD_BaseFrameworkEntities>>());

            //角色信息
            unityContainer.RegisterType<Isys_RoleInfoBLL, Sys_RoleInfoBLL>(new HttpContextLifetimeManager<Isys_RoleInfoBLL>());
            unityContainer.RegisterType<Isys_RoleInfoDAL, Sys_RoleInfoDAL>(new HttpContextLifetimeManager<Isys_RoleInfoDAL>());

            //用户信息
            unityContainer.RegisterType<Isys_UserInfoBLL, Sys_UserInfoBLL>(new HttpContextLifetimeManager<Isys_UserInfoBLL>());
            unityContainer.RegisterType<Isys_UserInfoDAL, Sys_UserInfoDAL>(new HttpContextLifetimeManager<Isys_UserInfoDAL>());
            

            //用户信息(视图)
            unityContainer.RegisterType<Iview_sys_UserInfo_BLL, View_sys_UserInfo_BLL>(new HttpContextLifetimeManager<Iview_sys_UserInfo_BLL>());
            unityContainer.RegisterType<IView_SysUserInfoDAL, View_SysUserInfoDAL>(new HttpContextLifetimeManager<IView_SysUserInfoDAL>());

            //功能模块信息
            unityContainer.RegisterType<Isys_FunctionBLL, Sys_FunctionBLL>(new HttpContextLifetimeManager<Isys_FunctionBLL>());
            unityContainer.RegisterType<Isys_FunctionDAL, Sys_FunctionDAL>(new HttpContextLifetimeManager<Isys_FunctionDAL>());


            //权限管理
            unityContainer.RegisterType<Isys_PermissionBLL, Sys_PermissionBLL>(new HttpContextLifetimeManager<Isys_PermissionBLL>());
            unityContainer.RegisterType<Isys_PermissionDAL, Sys_PermissionDAL>(new HttpContextLifetimeManager<Isys_PermissionDAL>());

            //医疗机构管理
            unityContainer.RegisterType<Idic_OrganizationBLL, Dic_OrganizationBLL>(new HttpContextLifetimeManager<Idic_OrganizationBLL>());
            unityContainer.RegisterType<Idic_OrganizationDAL, Dic_OrganizationDAL>(new HttpContextLifetimeManager<Idic_OrganizationDAL>());
 
            //区域管理
            unityContainer.RegisterType<Isys_AreaBLL, Sys_AreaBLL>(new HttpContextLifetimeManager<Isys_AreaBLL>());
            unityContainer.RegisterType<Isys_AreaDAL, Sys_AreaDAL>(new HttpContextLifetimeManager<Isys_AreaDAL>());
 
            //字典管理
            unityContainer.RegisterType<Idic_DictBLL, Dic_DictBLL>(new HttpContextLifetimeManager<Idic_DictBLL>());
            unityContainer.RegisterType<Idic_DictDAL, Dic_DictDAL>(new HttpContextLifetimeManager<Idic_DictDAL>());

            //案件受理记录（公民和个体商户）
            unityContainer.RegisterType<IXZCF_WS_AJSLJLBLL, XZCF_WS_AJSLJLBLL>(new HttpContextLifetimeManager<IXZCF_WS_AJSLJLBLL>());
            unityContainer.RegisterType<IXZCF_WS_AJSLJLDAL, XZCF_WS_AJSLJLDAL>(new HttpContextLifetimeManager<IXZCF_WS_AJSLJLDAL>());

            //立案报告（公民和个体商户）
            unityContainer.RegisterType<IXZCF_WS_LABGBLL, XZCF_WS_LABGBLL>(new HttpContextLifetimeManager<IXZCF_WS_LABGBLL>());
            unityContainer.RegisterType<IXZCF_WS_LABGDAL, XZCF_WS_LABGDAL>(new HttpContextLifetimeManager<IXZCF_WS_LABGDAL>());

            //案件移送书（公民和个体商户）
            unityContainer.RegisterType<IXZCF_WS_AJYSSBLL, XZCF_WS_AJYSSBLL>(new HttpContextLifetimeManager<IXZCF_WS_AJYSSBLL>());
            unityContainer.RegisterType<IXZCF_WS_AJYSSDAL, XZCF_WS_AJYSSDAL>(new HttpContextLifetimeManager<IXZCF_WS_AJYSSDAL>());

            //询问笔录（公民和个体商户）
            unityContainer.RegisterType<IXZCF_WS_XWBLBLL, XZCF_WS_XWBLBLL>(new HttpContextLifetimeManager<IXZCF_WS_XWBLBLL>());
            unityContainer.RegisterType<IXZCF_WS_XWBLDAL, XZCF_WS_XWBLDAL>(new HttpContextLifetimeManager<IXZCF_WS_XWBLDAL>());

            //证据保存决定书（公民和个体商户）
            unityContainer.RegisterType<IXZCF_WS_ZJBCJDSBLL, XZCF_WS_ZJBCJDSBLL>(new HttpContextLifetimeManager<IXZCF_WS_ZJBCJDSBLL>());
            unityContainer.RegisterType<IXZCF_WS_ZJBCJDSDAL, XZCF_WS_ZJBCJDSDAL>(new HttpContextLifetimeManager<IXZCF_WS_ZJBCJDSDAL>());
            //证据保存处理决定书（公民和个体商户）
            unityContainer.RegisterType<IXZCF_WS_ZJBCCLJDSBLL, XZCF_WS_ZJBCCLJDSBLL>(new HttpContextLifetimeManager<IXZCF_WS_ZJBCCLJDSBLL>());
            unityContainer.RegisterType<IXZCF_WS_ZJBCCLJDSDAL, XZCF_WS_ZJBCCLJDSDAL>(new HttpContextLifetimeManager<IXZCF_WS_ZJBCCLJDSDAL>());
            //案件终结报告（公民和个体商户）
            unityContainer.RegisterType<IXZCF_WS_AJDCZJBGBLL, XZCF_WS_AJDCZJBGBLL>(new HttpContextLifetimeManager<IXZCF_WS_AJDCZJBGBLL>());
            unityContainer.RegisterType<IXZCF_WS_AJDCZJBGDAL, XZCF_WS_AJDCZJBGDAL>(new HttpContextLifetimeManager<IXZCF_WS_AJDCZJBGDAL>());
            #endregion

            Application.Add("UnityContainer", unityContainer);
        }
    }
}